package com.atguigu.gmall.common.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @program: gmall-parent
 * @author: Mr.Zhuo
 * @create: 2022-04-08 15:20
 **/
@Configuration
public class ThreadPoolConfig  {

    @Bean
    public ThreadPoolExecutor threadPoolExecutor(){
        return new ThreadPoolExecutor(9,500,30, TimeUnit.SECONDS,new ArrayBlockingQueue<>(10000));
    }
}
